package com.wanmait.zaisousuo.service.Impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.zaisousuo.mapper.CompanyApprovalMapper;
import com.wanmait.zaisousuo.mapper.UserinfoMapper;
import com.wanmait.zaisousuo.pojo.CompanyApproval;
import com.wanmait.zaisousuo.pojo.Userinfo;
import com.wanmait.zaisousuo.service.CompanyApprovalService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.List;

@Service
@Transactional
public class CompanyApprovalServiceImpl implements CompanyApprovalService
{
    @Resource
    private CompanyApprovalMapper companyApprovalMapper;
    @Resource
    private UserinfoMapper userinfoMapper;
    @Override
    public void insert(CompanyApproval object) {

    }

    @Override
    public void update(CompanyApproval object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public CompanyApproval findById(Integer id) {
        return null;
    }

    @Override
    public List<CompanyApproval> findAll() {
        return null;
    }

    @Override
    public List<CompanyApproval> findAll(CompanyApproval object) {
        return null;
    }

    @Override
    public int getDataCount() {
        return 0;
    }

    @Override
    public int getDataCount(CompanyApproval object) {
        return 0;
    }

    @Override
    public PageInfo<CompanyApproval> findList(int pageNum) {
        return null;
    }

    @Override
    public CompanyApproval findCompanyName(String companyName) {
        return companyApprovalMapper.findCompanyName(companyName);
    }

    @Override
    public void companyAuthenticat(CompanyApproval companyApproval, HttpSession session) {
        companyApprovalMapper.companyAuthenticat(companyApproval);
        Userinfo userinfo = (Userinfo)session.getAttribute("userinfo");
        userinfoMapper.updateCompany(companyApproval.getId(),userinfo.getId());
    }
}
